/*
 * MArrowButton.java
 * 本类是一个下拉按钮
 */
package org.vacoor.ui.qq.combobox;

import javax.swing.*;
import javax.swing.plaf.basic.BasicArrowButton;

import org.vacoor.ui.qq.resources.UIResourceManager;

public class ArrowButton extends JButton {

    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private ImageIcon arrowIcon;
    private ImageIcon arrowRollIcon;
    private ImageIcon arrowPressIcon;

    public ArrowButton() {
        arrowIcon = UIResourceManager.getMComArrowImg();
        arrowRollIcon = UIResourceManager.getMComArrowRollImg();
        arrowPressIcon = UIResourceManager.getMComArrowPressImg();
        this.setName("ComboBox.arrowButton");
        this.setBorder(null);
        this.setIcon(arrowIcon);
        this.setPressedIcon(arrowPressIcon);
        //设置反转图片
        this.setRolloverEnabled(true);
        this.setRolloverIcon(arrowRollIcon);
        //不绘制焦点
        this.setFocusPainted(false);
        //不绘制组件区域
        this.setContentAreaFilled(false);
//        new BasicArrowButton()
    }

    public static void main(String[] args) {
        JFrame frame = new JFrame();
        BasicArrowButton btn = new BasicArrowButton(BasicArrowButton.EAST);
        frame.add(btn);
//        frame.add(new ArrowButton());
        frame.setSize(400, 400);
        frame.setVisible(true);
    }
}
